﻿/* 2. Write a program that reads two arrays from the console and compares them element by element. */

using System;

public class CompareArraysByElements
{
    public static void Main()
    {
        // The arrays will contains only double numbers.
        // For string arrays look 'Problem 14. Quick Sort Algorithm'.

        double[][] arrays = new double[2][];
        int arrayLength;

        Console.Write("\nThe length of both arrays: ");
        arrayLength = int.Parse(Console.ReadLine());
        Console.WriteLine();

        if (0 < arrayLength)
        {
            arrays[0] = new double[arrayLength];
            arrays[1] = new double[arrayLength];
            for (int i = 0; i < 2; i++)
            {
                for (int j = 0; j < arrayLength; j++)
                {
                    Console.Write("Array{0}[{1}] = ", i, j);
                    arrays[i][j] = double.Parse(Console.ReadLine());
                }

                Console.WriteLine();
            }

            for (int i = 0; i < arrayLength; i++)
                Console.WriteLine("{0} = Array0[{1}] {2} Array1[{1}] = {3}", arrays[0][i], i,
                    arrays[0][i] < arrays[1][i] ? "<" : (arrays[0][i] > arrays[1][i] ? ">" : "="),
                        arrays[1][i]);

            Console.WriteLine();
        }
        else
            Console.WriteLine("The length of both arrays must be natural!\n");
    }
}